package cn.caplike.demo.repository.annotation;

import java.lang.annotation.Annotation;

public class Main {

    public static void main(String[] args) {
        System.out.println("Is annotation present: " + TheClass.class.isAnnotationPresent(TheAnnotation.class));
        final TheAnnotation annotation = TheClass.class.getAnnotation(TheAnnotation.class);
        System.out.println("Annotation class: " + annotation.getClass());
        System.out.println("Annotation class is an annotation: " + annotation.getClass().isAnnotation());

        final Annotation[] annotations = TheClass.class.getAnnotations();
        final Class<? extends Annotation> annotationType = annotations[0].annotationType();
        System.out.println("Annotation type: " + annotationType);
        System.out.println(annotationType.equals(TheAnnotation.class));
    }
}
